﻿<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="../images/favicon.ico">
<!-- 本框架基本脚本和样式 -->
<script type="text/javascript"
	src="${path }/resource/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript"
	src="${path }/resource/js/systools/MBase.js"></script>
<!-- 富文本编辑器 -->
<link rel="stylesheet" type="text/css"
	href="${path }/resource/plugin/kindeditor/themes/default/default.css" />
<link rel="stylesheet" type="text/css"
	href="${path }/resource/plugin/kindeditor/plugins/code/prettify.css" />
<script type="text/javascript"
	src="${path }/resource/plugin/kindeditor/kindeditor.js"></script>
<script type="text/javascript"
	src="${path }/resource/plugin/kindeditor/lang/zh_CN.js"></script>
<script type="text/javascript"
	src="${path }/resource/plugin/kindeditor/plugins/code/prettify.js"></script>
	

<title></title>
</head>
<div class="ibox-content">
	<form class="form-horizontal" id="dataform"
		onsubmit="javascripr:return false;">
		<input type="hidden" name="tokenUrl" value="${tokenUrl}">	 
		<input type="hidden" name="token" value="${token}">
		<input type="hidden" name="projId" value="${projId}">
		<c:if test="${obj ne null }">
			<input type="hidden" name="id" value="${obj.id }">
		</c:if>
		<div class="form-group">
			<label class="col-sm-2 control-label">标题<span class="text-danger">*</span></label>
			<div class="col-sm-10">
				<input type="text" dataType="*1-200" class="form-control"
					name="title" value="<c:out value="${obj.title}"/>">
				<div class="Validform_checktip"></div>
			</div>
		</div>
      
		<div class="form-group ">
			<label class="col-sm-2 control-label">级别<span class="text-danger">*</span></label>
			<div class="col-sm-4">
				<select class="form-control autoFull" name="grade" dataType="*"
					data-url="${path}/admin/dataDictionary/showDataDictionary" 
					data-filed="name" 
					data-value="name"
					data-param="{type:'bug级别'}"
					data-def="${obj.grade}"
					>
					<option value="">--请选择级别--</option>
				</select>
				<div class="Validform_checktip"></div>
			</div>
			
			<label class="col-sm-2 control-label">指派给<span class="text-danger">*</span></label>
			<div class="col-sm-4">
			   <select class="form-control autoFull" name="userId" dataType="*"
					data-url="${path}/admin/projUser/showListByModel" 
					data-value="userId"
					data-filed="userName" 
					data-def="${obj.userId}"
					data-param="{projId:${projId}}"
					>
					<option value="">--请选择指派给谁--</option>
				</select>
				<div class="Validform_checktip"></div>
			</div>
		</div>
		 <c:if test="${obj ne null}">
		<div class="form-group ">
			<label class="col-sm-2 control-label">bug状态</label>
			<div class="col-sm-4">
			    <select class="form-control autoFull" name="status" dataType="*1-20" ignore="ignore"
					data-url="${path}/admin/dataDictionary/showDataDictionary" 
					data-filed="name" 
					data-value="name"
					data-param="{type:'bug状态'}"
					data-def="${obj.status}"
					>
					<option value="">--请选择状态--</option>
				</select>
				<div class="Validform_checktip"></div>
			 </div>
			
			<label class="col-sm-2 control-label">方案<span class="text-danger">*</span></label>
			<div class="col-sm-4">
				<select class="form-control autoFull" name="type" dataType="*1-20"
					data-url="${path}/admin/dataDictionary/showDataDictionary" 
					data-filed="name" 
					data-value="name"
					data-param="{type:'解决方案'}"
					data-def="${obj.type}"
					>
					<option value="">--请选择方案--</option>
				</select>
				<div class="Validform_checktip"></div>
			</div>
		 </div>
		</c:if>
		<div class="form-group ">
			<label class="col-sm-2 control-label">bug类型</label>
			<div class="col-sm-4">
			    <select class="form-control autoFull" name="kind" dataType="*1-20" ignore="ignore"
					data-url="${path}/admin/dataDictionary/showDataDictionary" 
					data-filed="name" 
					data-value="name"
					data-param="{type:'bug类型'}"
					data-def="${obj.kind}" >
					<option value="">--请选择bug类型--</option>
				</select>
			 </div>
			<label class="col-sm-2 control-label">所属模块<span class="text-danger">*</span></label>
			<div class="col-sm-4">
					<select class="form-control select2 " size="1" name="interfaceId"
						id="parentId" dataType="*">
						<option value="" selected="selected">请选择项目模块</option>
					</select>				
				<div class="Validform_checktip"></div>
			</div>
		 </div>
		 <div class="form-group ">
			<label class="col-sm-2 control-label">所属任务</label>
			<div class="col-sm-4">
			    <select class="form-control select2 autoFull" name="taskId" 
					data-url="${path}/admin/task/showList?limit=1000&projId=${param.projId}" 
					data-filed="name" 
					data-value="id"
					data-def="${obj.taskId}" >
					<option value="">--请选择bug关联的任务--</option>
				</select>
			 </div>
			 
		 </div>
		 
		 
		 <div class="form-group">
			<label class="col-sm-2 control-label">bug描述</label>
			<div class="col-sm-8">
				<textarea name="describes" id="describes">
					${obj.describes}
				</textarea>
			</div>
			<div class="Validform_checktip"></div>
		</div>
		
		   <%--  <div class="form-group">
			<label class="col-sm-2 control-label">上传图片</label>
			<div class="col-sm-9">
				<input onclick="MTools.chooesFile('#fileText')"
					class="input-text upload-url radius form-control" type="text" id="showFileName"
					readonly style="width: 30%;display: inline;"> 
					<a onclick="MTools.chooesFile('#fileText')" class="btn btn-primary radius"> 
					<i class="fa fa-cloud-upload"></i> 浏览文件 </a> 
					<!-- <input type="button" class='btn btn-primary radius'
					onclick="MTools.upFile('#submitBtn')" value="上传"> -->
					 <a id="selectInServices" class="btn btn-primary radius"> 
					 <i class="fa fa-cloud"></i> 远程图库
				</a>
			</div>
		</div>
		
		<div class="form-group">
			<div class="col-sm-2 control-label"></div>
			<div class="col-sm-9">
				<c:if test="${obj ne null }">
					<input type="hidden" value="${obj.shopImag }" name="shopImag"
						id="hiddenImg" />
					<img width="150" id='img_1' src="${obj.shopImag }" />
				</c:if>
				<c:if test="${obj eq null }">
					<input type="hidden" name="shopImag" id="hiddenImg" />
					<img width="150" id='img_1' />
				</c:if>
			</div>
		</div> --%>
		
       
		<div class="form-group ">
			<div class="col-sm-12 text-center">
				<a href="javascript:;" onclick="myForm.submit()"
					class="btn btn-success radius">保存</a>&nbsp;&nbsp;&nbsp;&nbsp; 
					<button onclick="MTools.closeForm()" class="btn btn-danger radius" type="button">取消</button>
			</div>
		</div>
	</form>
	
	
</div>
<!-- PC图片上传表单 begin-->
	<%-- <form class="form form-horizontal" method="post" style="display: none;"
		enctype="multipart/form-data" target="blankFrame"
		action="${path }/resource/plugin/kindeditor/upload_json.jsp?dir=image&flag=img_1&hiddenImg=hiddenImg">

		<input id="fileText" type="file" multiple name="file-1"	onchange="MTools.selectFile('#showFileName','#fileText','#submitBtn')" /> 
		<input type="submit" id="submitBtn"/>
	</form>
	
	<iframe src="" name="blankFrame" id="blankFrame"
		style="height: 100px; width: 100px; display: none;"> </iframe> --%>
	
<script type="text/javascript">
 var editor;
 var myForm;
$(function() {	
		//初始化页面的一些元素以及数据
		   //下拉框自动赋值
		MTools.autoFullSelect();
		  //带搜索的下拉框
		$(".select2").select2({'width':'100%'});
		  //创建富文本
		MUI.createEdit("describes", '100%', '400px', 'editor');
		initFunctionList();
		
		//表格初始化
		myForm=MForm.initForm({
			invokeUrl:"${path}/admin/bug/addOrModify",
			beforeSubmit:function(){
				editor.sync();
			},
			afterSubmit:function(){
				parent.myGrid.serchData();
			},
		});
		
	});

	
	/**
	 * 初始化模块
	 */
	function initFunctionList() {
		$.AjaxProxy({
			a : false,
			c : false
		}).invoke("${path}/admin/interfaceCate/all?projId=${projId}", function(loj) {
			$("#parentId").createSelectTree(loj.attr("result").rows, {
				append : true,
				value:"name",
				defaultValue:"${obj.interfaceId}"
			});
		});
	
	}
   
</script>
</body>
</html>